package com.itheima.integerdemo01;

import java.util.Arrays;

public class IntegerDemo01 {

    public static void main(String[] args) {

        String s = "91 27 46 38 50";

        String[] s1 = s.split(" ");

        int[] arr = new int[s1.length];
        for (int i = 0; i < s1.length; i++) {

            String s2 = s1[i];

            int a = Integer.parseInt(s2);
            arr[i] = a;

        }

        Arrays.sort(arr);

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {

            if(i == arr.length - 1){
                sb.append(arr[i]);
            }else {
//                sb.append(arr[i] + " ");
                sb.append(arr[i]).append(" ");
            }

        }

        String s2 = sb.toString();
        System.out.println(s2);

    }

}
